package com.android.commcount.ui.activity;

import android.os.Build;
import android.widget.SeekBar;

import androidx.annotation.RequiresApi;

import com.android.baselibrary.interface_.OkHttpCallBack;
import com.android.baselibrary.responce.BaseResponce;
import com.android.baselibrary.tool.CommLoading;
import com.android.baselibrary.tool.CommToast;
import com.android.baselibrary.tool.Log;
import com.android.baselibrary.view.Comm_HeadView;
import com.android.baselibrary.view.MultiStateView;
import com.android.commcount.R;
import com.android.commcount.R2;
import com.android.commcount.event.Event_Count_BgChange;
import com.android.commcount.event.Event_Count_ChangeCircleRadius;
import com.android.commcount.manager.API_Manager;
import com.android.commcount.manager.ImageRecConfig;
import com.jaygoo.widget.OnRangeChangedListener;
import com.jaygoo.widget.RangeSeekBar;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;

public class Setting_CommCount_ShadeColorActivity extends BaseActivity {

    @BindView(R2.id.multiplestatusView)
    MultiStateView multiplestatusView;
    @BindView(R2.id.comm_title)
    Comm_HeadView comm_title;
    @BindView(R2.id.seekbar_shade)
    SeekBar seekbar_shade;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_setting_commcount_shadecolor;
    }

    @Override
    protected void initView() {
        comm_title.setTitle("遮罩透明度调整");
    }

    int min = 50;

    @RequiresApi(api = Build.VERSION_CODES.O)
    @Override
    protected void initData() {
        //初始化背景
        seekbar_shade.setMin(min);
        seekbar_shade.setMax(255 - min);


        seekbar_shade.setProgress(ImageRecConfig.getFrame_BgColor_Alpha(mContext) - min);

        seekbar_shade.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                //改变精度的大小
                ImageRecConfig.setFrame_BgColor_Alpha(mContext, progress + min);
                EventBus.getDefault().post(new Event_Count_BgChange());
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }

//    @OnClick({R.id.tv_sendcode})
//    public void onViewClicked(View view) {
//        switch (view.getId()) {
//            case R.id.tv_sendcode:
//                break;
//        }
//    }

}
